﻿using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using ShevaEngine.Core.Foundation;

namespace ShevaEngine.Core.Modules.ArtificialIntelligence.Pathfinding
{
    /// <summary>
    /// Navigation graph node triangle.
    /// </summary>
    public class NavigationGraphNodeQuad2D : NavigationGraphNode
    {
        /// <summary>Quad.</summary>
        public Quad2D Quad;

        /// <summary>
        /// Constructor.
        /// </summary>
        public NavigationGraphNodeQuad2D(Quad2D quad)
            : base()
        {
            this.Quad = quad;
        }

        /// <summary>
        /// Does node contain location ?
        /// </summary>
        /// <param name="vertex">Vertex.</param>
        /// <returns></returns>
        public override bool ContainsLocation(Vector3 vertex)
        {
            return this.Quad.ContainsVertex(vertex);
        }

        /// <summary>
        /// Method returns border vertices.
        /// </summary>
        /// <returns>Border vertices.</returns>
        public override List<Vector3> GetBorderVertices()
        {
            return this.Quad.GetBorderVertices();
        }
    }
}
